﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace ESOL.Controls
{
    public partial class EsolShortcut : UserControl
    {
        public Image ShortcutIcon
        {
            get { return pboxShortcutIcon.Image; }
            set { pboxShortcutIcon.Image = value; }
        }

        public new string Text
        {
            get { return lblShortcutName.Text; }
            set { lblShortcutName.Text = value; }
        }

        public delegate void RunDoubleClickShortcut(object tag);
        public RunDoubleClickShortcut DoubleClickShortcut;

        public EsolShortcut()
        {
            InitializeComponent();
        }

        private void pboxShortcutIcon_MouseEnter(object sender, EventArgs e)
        {
            this.BackColor = Color.LightBlue;
            this.Cursor = Cursors.Hand;
        }

        private void pboxShortcutIcon_MouseLeave(object sender, EventArgs e)
        {
            this.BackColor = Color.Transparent;

        }

        private void lblShortcutName_MouseEnter(object sender, EventArgs e)
        {
            this.BackColor = Color.LightBlue;
            this.Cursor = Cursors.Hand;
        }

        private void lblShortcutName_MouseLeave(object sender, EventArgs e)
        {
            this.BackColor = Color.Transparent;
        }

        private void pboxShortcutIcon_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            //DoubleClickShortcut(this.Tag);
        }

        private void lblShortcutName_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            //DoubleClickShortcut(this.Tag);
        }

        private void EsolShortcut_MouseEnter(object sender, EventArgs e)
        {
            this.BackColor = Color.LightBlue;
            this.Cursor = Cursors.Hand;
        }

        private void EsolShortcut_MouseLeave(object sender, EventArgs e)
        {
            this.BackColor = Color.Transparent;
        }

        private void pboxShortcutIcon_Click(object sender, EventArgs e)
        {
            DoubleClickShortcut(this.Tag);
        }

        private void lblShortcutName_Click(object sender, EventArgs e)
        {
            DoubleClickShortcut(this.Tag);
        }

        private void EsolShortcut_Click(object sender, EventArgs e)
        {
            DoubleClickShortcut(this.Tag);
        }
    }
}
